import axios from "../utils/http";

const CateStore = {
    namespaced: true,
    state: () => ({
        cate_list: []
    }),
    mutations: {
        CateMutations(state, list) {
            state.cate_list = list
        }
    },
    actions: {
        CateActions(context) {
            axios.get("/api/catelist?istree=1").then(
                res => {
                    if (res.code === 200) {
                        context.commit("CateMutations", res.list)
                    }
                }
            )
        }
    }
}

export default CateStore